<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    /*
    resolve和reject都接收一个参数，这个参数是成功或者失败的信息
    会把信息放在promise实列属性(promiesresule)上
    */
   const p1 = new Promise((resolve,reject)=>{
    let a = 1
    setTimeout(()=>{
      //返回成功的值
      // resolve(a)
      //返回失败的值
        reject()
    },2000)
   })
   console.log('p1',p1);

  </script>
</body>
</html>